import HGPMSVisualizer from './HGPMSVisualizer';
import React from 'react';

// 定义参数类型接口
interface AlgorithmResultProps {
  loading: boolean;
  algorithm: string;
  result: any; // 可以根据实际数据结构进一步定义
}

// 定义默认可视化组件
const DefaultVisualization: React.FC<{loading: boolean; results: any}> = ({ loading, results }) => {
  return (
    <div>
      {loading ? (
        <p>加载中...</p>
      ) : (
        <pre>{JSON.stringify(results, null, 2)}</pre>
      )}
    </div>
  );
};

const AlgorithmResult: React.FC<AlgorithmResultProps> = ({ loading, algorithm, result }) => {
  // 根据算法类型渲染不同的可视化组件
  const renderVisualization = () => {
    switch(algorithm) {
      // ... 其他算法的case
      case "异构图模式挖掘算法(HGPMS)":
        return <HGPMSVisualizer loading={loading} results={result} />;
      default:
        return <DefaultVisualization loading={loading} results={result} />;
    }
  };

  return (
    <div className="algorithm-result">
      {renderVisualization()}
    </div>
  );
};

export default AlgorithmResult; 